<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>多数据源配置</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
</head>
<body>
    <button name = "datasource1" class="datasource">数据源1</button>
    <button name = "datasource2" class="datasource">数据源2</button>

</body>
    <script th:src="@{/webjars/jquery/3.3.1/jquery-1.8.3.js}"></script>
    <script>
        $(".datasource").click(function () {
            var datasource = $(this).attr("name");
            $.get("/environment/"+datasource,function (data) {
                alert(data)
            })
        })
    </script>
</html>